package com.medical.service.essentialinfo.essentialinfoImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;



import com.github.pagehelper.PageInfo;
import com.medical.mapper.essentialinfo.DiseaseInfoMapper;

import com.medical.pojo.DiseaseInfo;
import com.medical.pojo.PageDisease;
import com.medical.service.DiseaseInfoService;

@Service
public class DiseaseInfoServiceImpl implements DiseaseInfoService {
	
	private PageDisease pageDisease  = new PageDisease();
	
	@Autowired
	private DiseaseInfoMapper diseaseInfoMapper;
	@Override
	public PageDisease queryAllDiseaseinfo(String name) {
		
		List<DiseaseInfo> AllDiseaseInfo = diseaseInfoMapper.selectAllDiseaseInfo(name);
		PageInfo<DiseaseInfo> pagediseaseinfo = new PageInfo<DiseaseInfo>(AllDiseaseInfo);
		pageDisease.setDiseaseInfo(AllDiseaseInfo);
		pageDisease.setDiseasepageInfo(pagediseaseinfo);
		
		return pageDisease;
	}
	@Override
	public void updateDiseaseInfo(DiseaseInfo diseaseInfo) {
		
		diseaseInfoMapper.updateDiseaseInfo(diseaseInfo);
		
	}
	@Override
	public int deleteDiseaseInfo(String id) {
		
		return diseaseInfoMapper.deleteDiseaseInfo(id);
	}
	@Override
	public int insertDiseaseInfo(DiseaseInfo diseaseInfo) {
		
		return diseaseInfoMapper.insertDiseaseInfo(diseaseInfo);
	}
	
	
	

}
